package test.inheritance;

/**
 * Created by IntelliJ IDEA.
 * User: caporegim
 * Date: 08.09.12
 * Time: 11:08
 * To change this template use File | Settings | File Templates.
 */
public class Child extends Parent{
    private Object privateA;
    protected Object protectedA;
    Object packagePrivateA;
    public Object publicA;

    public Child() {
        System.out.println("Child Constructor");
        super.protectedA = new Object();

    }

    public static void main(String[] args) {
       // Child child = (Child) new Parent();    //wrong cast
        Parent childAsParent = new Child();
        System.out.println(childAsParent.protectedA);
        //System.out.println(childAsParent.s);

    }
}
